<?php 
namespace Home\Controller;
use Home\Model\EmailsModel;
include "D:/xampp/htdocs/Projecttwo/phpqrcode/phpqrcode.php";
use Think\Controller;
class RegisterController extends Controller{
	function register(){
		$this->display();
	}
	function register_check(){
		$UserOb=D('User');
			$cRe=$UserOb->create();
			if ($cRe) {
				unset($_POST['repassword']);
				$re=$UserOb->add();
				if ($re) {
					$this->success("注册成功",U('Home/Login/login'));
				}else{
					$this->error("注册失败",U('Home/Register/register'));
				}
			}else{
				$info=$UserOb->getError();
				$this->assign('info',$info);
				$this->assign('arr',$_POST);
				$this->display('register');
		    }
	}
function emails(){
    $email = new  \Home\Model\EmailModel();
    $smtpserver = "smtp.163.com";//SMTP服务器
    $smtpserverport =25;//SMTP服务器端口
    $smtpusermail = "15072242004@163.com";//SMTP服务器的用户邮箱
    $smtpemailto = "244332656@qq.com";//发送给谁
    $smtpuser = "15072242004@163.com";//SMTP服务器的用户帐号
    $smtppass = "LZH690921";//SMTP服务器的用户密码
    $mailsubject = "111111";//邮件主题
    $mailbody = "<h1> 11111 </h1>";//邮件内容
    $mailtype = "HTML";//邮件格式（HTML/TXT）,TXT为文本邮件
    ##########################################
//    $smtp = new smtp($smtpserver,$smtpserverport,true,$smtpuser,$smtppass);//这里面的一个true是表示使用身份验证,否则不使用身份验证.
//    $smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype);
    $smtp           = $email->smtp($smtpserver, $smtpserverport, true, $smtpuser, $smtppass);
    $a = $email->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype);
    dump($a);
    if ($a){
        dump('成功');
    }
}

function a(){

    $a = new EmailsModel();
//    $smtpemailto = "244332656@qq.com";//发送给谁
//    $smtpusermail = "15072242004@163.com";//SMTP服务器的用户邮箱
//    $mailsubject = "小宝贝";//邮件主题
//    $mailbody = "<h1> 我是你爸爸 </h1>";//邮件内容
//    $mailtype = "HTML";//邮件格式（HTML/TXT）,TXT为文本邮件
//
//    $b = $a->think_send_mail($smtpemailto,$smtpusermail,$mailsubject,$mailbody,$mailtype);
    $b = $a->send_sms_code(15072242004,'123456789');
   dump($b);
}
function b(){
    $a = \QRcode::png('那个就是我挺喜欢你的，可以跟你在一起嘛！>.<');
    dump($a);
//    $a = floor(2.00000)/floor(1.10000);
//    dump($a);
}
}